﻿using RPAVIEW.views.controlLibrary;
using System.Windows;
using System.Windows.Controls;

namespace RPAVIEW.views.EditPage.flows.TypeWebInputN {
    /// <summary>
    /// Advance.xaml 的交互逻辑
    /// </summary>
    public partial class Advance:BaseParamViewAction{
        public Advance() {
            InitializeComponent();
        }

        public override void UpdateSource() {
            this.inputType.GetBindingExpression(ComboBox.SelectedIndexProperty).UpdateSource();
            this.inputInterval.GetBindingExpression(SelVarTextBox.text).UpdateSource();
            this.afterInputDelay.GetBindingExpression(SelVarTextBox.text).UpdateSource();
            this.waitEleTime.GetBindingExpression(SelVarTextBox.text).UpdateSource();
            this.clickBeforeInput.GetBindingExpression(CheckBox.IsCheckedProperty).UpdateSource();
        }

        private void InputTypeChanged(object sender, SelectionChangedEventArgs e) {
            int it = this.inputType.SelectedIndex;
            if(it == 0) { 
                this.intervalRow.Height = GridLength.Auto;
                this.clickBeforeInputRow.Height = GridLength.Auto;
            }else if(it == 1) {
                this.intervalRow.Height = new GridLength(0);
                this.clickBeforeInputRow.Height = GridLength.Auto;
            } else { 
                this.intervalRow.Height = new GridLength(0);
                this.clickBeforeInputRow.Height = new GridLength(0);
            }
        }
    }
}
